import java.io.*;
import java.lang.Math;
public class Main {
	float x;
	float y;
	public double distance(Main p) {
		
		return Math.sqrt((x-p.x)*(x-p.x)+(y-p.y)*(y-p.y));
	}
	public double distance(int x,int y) {
		return Math.sqrt((this.x-x)*(this.x-x)+(this.y-y)*(this.y-y));
	}
	public static double distance(Main a,Main b) {
		return Math.sqrt((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y));
	}
	public Main(float a,float b) {
		x=a;
		y=b;	
	}
	public Main() {
		this(0,0);	
	}
	public static void main(String[] args) {
		Main p=new Main(1,2);
		Main x=new Main(3,4);
		Main y=new Main(5,6);	
		System.out.println("x点到(x,y)点距离为："+(float)(x.distance(7,8)));
		System.out.println("x点到P点距离为："+(float)x.distance(p));
		System.out.println("x,y两点距离为："+(float)distance(x,y));
	}
}